package com.example.java.base.hutool;


import cn.hutool.core.annotation.AnnotationUtil;
import cn.hutool.core.math.MathUtil;
import cn.hutool.core.thread.ThreadUtil;

import java.lang.annotation.RetentionPolicy;
import java.util.concurrent.ExecutorService;

/**
 * Test:测试糊涂工具包
 *
 * @author zhangxiaoxiang
 * @date 2020/11/05
 */
public class Test {
    @AnnotationForTest("测试")
    public static   class ClassWithAnnotation{

    }

   @org.junit.Test
    public void test() {
       // value为"测试"
       Class<AnnotationForTest> annotation = AnnotationForTest.class;
       //获取默认值(注意优先级)
       Object value = AnnotationUtil.getAnnotationValue(ClassWithAnnotation.class,annotation);
       RetentionPolicy retentionPolicy = AnnotationUtil.getRetentionPolicy(annotation);
       Object name = AnnotationUtil.getAnnotationValue(ClassWithAnnotation.class, annotation, "name");
       System.out.println("value = " + value);
       System.out.println("retentionPolicy = " + retentionPolicy);
       System.out.println("name = " + name);

   }
}
